Skip to content

BUG: crosstab with margins=True and dropna=False #12643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from

Conversation

OXPHOS
Copy link
Contributor

@OXPHOS OXPHOS commented Mar 16, 2016

OXPHOS and others added 7 commits March 14, 2016 03:08
To fix bug pandas-dev#12577: Crosstab margins ignoring dropna
if dropna, pass truncated data to _add_margin
simplified codes in pivot_table()
updated what’s new entry
updated comments in test_pivot.py
GH#12642
- Modified _add_margins
- Added tests
- Updated what’s new
@codecov-io
Copy link

Powered by Codecov. Updated on successful CI builds.

@jreback jreback added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Mar 16, 2016
@@ -936,6 +936,84 @@ def test_crosstab_no_overlap(self):

tm.assert_frame_equal(actual, expected)

def test_margin_ignore_dropna_bug(self):
# GH 12577
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so rename to test_margin_dropna

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to make sure I got this right -

I current have two test methods respectively for this one and #12614. They're both margins and dropna issues for sure.

And I should merge these two methods into one, and name it test_margin_dropna, correct?

And I'll keep the issue numbers in comments?

Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that sounds fine (and just add this number after the other one). Idea is to have same tests together even though they occurred via different issues.

@OXPHOS
Copy link
Contributor Author

OXPHOS commented Mar 16, 2016

I'll wait for #12327

@jreback
Copy link
Contributor

jreback commented Mar 16, 2016

make sure you rebase on master (to pick up the merges from the other issue).

you can submit a separate PR that does #12327 if you want (just incorporate those commits) and fixup as I have suggested.

# Conflicts:
#	doc/source/whatsnew/v0.18.1.txt
#	pandas/tools/tests/test_pivot.py
@OXPHOS OXPHOS closed this Mar 16, 2016
@OXPHOS OXPHOS reopened this Mar 16, 2016
@OXPHOS OXPHOS closed this Mar 16, 2016
@OXPHOS
Copy link
Contributor Author

OXPHOS commented Mar 16, 2016

@jreback
Copy link
Contributor

jreback commented Mar 16, 2016

ideally you would clone his branch
then cherry pick commits you want onto yours

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: crosstab with margins=True and dropna=False
3 participants